#include <iostream>
using namespace std;
int main()
{
char ch;
int sum,n;
cin>>ch;
sum=0;
if(ch>='a'&&ch<='z')
{
n=ch-'a'+1;
sum+=n;	
}
else
sum=27;
cout <<sum;
return 0;		
}
//输入b 输出2 
  
